using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using TMS.Domain.Entity;
using TMS.Infrastructrue.Persistence.Configuration.Base;

namespace TMS.Infrastructrue.Persistence.Configuration
{
    public class StudentsConfiguration : BaseEntityConfiguration<Students>
    {
        public override void Configure(EntityTypeBuilder<Students> builder)
        {
            base.Configure(builder);

            builder.ToTable("students");

            builder.Property(x=>x.StudentId).HasColumnName("student_id").HasMaxLength(20000).HasColumnOrder(1);

            builder.Property(x=>x.StudentName).HasColumnName("student_name").HasMaxLength(20000).HasColumnOrder(2);

            builder.Property(x=>x.Sex).HasColumnName("sex").HasMaxLength(20000).HasColumnOrder(3);

            builder.Property(x=>x.IdentityNumber).HasColumnName("identity_number").HasMaxLength(20000).HasColumnOrder(4);

            builder.Property(x=>x.PhoneNumber).HasColumnName("phone_number").HasMaxLength(20000).HasColumnOrder(5);

            builder.Property(x=>x.ChattingNumber).HasColumnName("chatting_number").HasMaxLength(20000).HasColumnOrder(6);

            builder.Property(x=>x.QQNumber).HasColumnName("qq_number").HasMaxLength(20000).HasColumnOrder(7);

            builder.Property(x=>x.Address).HasColumnName("address").HasMaxLength(20000).HasColumnOrder(8);

            builder.Property(x=>x.FatherName).HasColumnName("father_name").HasMaxLength(20000).HasColumnOrder(9);

            builder.Property(x=>x.FatherPhone).HasColumnName("father_phone").HasMaxLength(20000).HasColumnOrder(10);

            builder.Property(x=>x.MontherName).HasColumnName("monther_name").HasMaxLength(20000).HasColumnOrder(11);

            builder.Property(x=>x.MontherPhone).HasColumnName("monther_phone").HasMaxLength(20000).HasColumnOrder(12);
            
            builder.Property(x=>x.ClassId).HasColumnName("class_id").HasMaxLength(20000).HasColumnOrder(13);
            
            builder.Property(x=>x.DormId).HasColumnName("dorm_id").HasMaxLength(20000).HasColumnOrder(14);

        }

    }
}